'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const ObjectId = Schema.ObjectId;

  const ExpertSchema = new Schema({
    user_id: { type: String },
    name: { type: String },
    hospital: { type: String },
    hospital_level: { type: String },
    physician: { type: String },
    physician_key: { type: String },
    categray: { type: String },
    metier: { type: String },
    avatar_image: { type: String },
    shanchang: { type: String },
    services: { type: Array },

    goodat: { type: Array },

    extend: {
      type: Schema.Types.Mixed
    },

    
    expert_collect: {
      parent_collect: { type: String },
      collect: { type: String },
    },

    score: { type: Number },
    help_total_count: { type: Number },
    follow_total_count: { type: Number },
    evaluate_total_count: { type: Number, default: 0 },
    
    create_at: { type: Date, default: Date.now },
    update_at: { type: Date, default: Date.now },
    
    deleted: { type: Boolean, default: false },
  });

  return mongoose.model('Expert', ExpertSchema);
};
